function [data] = synthBC3E(N, k, ensm)


%if(nargin==0)
% N    = 15;
% k    = 3;
% ensm = 20;
%end

for i=1:ensm
    
 p1 = [0.01,0.01,0.98];
 data1 = mnrnd(1,p1,round((N/3)));

 p2 = [0.96,0.02,0.02]; 
 data2 = mnrnd(1,p1,round((N/3)));
 
 data2 (:,1) = data2 (:,3);
 data2 (:,3) = 0;
 
 p3 = [0.05,0.05,0.90];
 data3 = mnrnd(1,p1,round((N/3)));
 
 data3 (:,2) = data3 (:,3);
 data3 (:,3) = 0;
  
 dataw1(i).w = [data1; data2; data3];
 dataw2(i).w = [data1; data2; data3];

end


data.dataw1 = dataw1;
data.dataw2 = dataw2;
data.r1     = ensm;
data.r2     = ensm;

data.truelabel=[3*ones(round((N/3)),1); ones(round((N/3)),1); 2*ones(round((N/3)),1)];

end




